/**
 * Created by chongsong on 15/3/12.
 */
function makeTime() {
    var week = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
    var day1 = new Date();

    var day2 = new Date();
    day2.setDate(day1.getDate() + 1);

    var day3 = new Date();
    day3.setDate(day1.getDate() + 2);

    var day4 = new Date();
    day4.setDate(day1.getDate() + 3);

    var day5 = new Date();
    day5.setDate(day1.getDate() + 4);

    return [{
        'day': (day1.getMonth() + 1) + "/" + (day1.getDate()>=10?day1.getDate():"0"+day1.getDate()),
        'week': '今天'
    }, {
        'day': (day2.getMonth() + 1) + "/" + (day2.getDate()>=10?day2.getDate():"0"+day2.getDate()),
        'week': '明天'
    }, {
        'day': (day3.getMonth() + 1) + "/" + (day3.getDate()>=10?day3.getDate():"0"+day3.getDate()),
        'week': '后天'
    }, {
        'day': (day4.getMonth() + 1) + "/" + (day4.getDate()>=10?day4.getDate():"0"+day4.getDate()),
        'week': week[day4.getDay()]
    }, {
        'day': (day5.getMonth() + 1) + "/" + (day5.getDate()>=10?day5.getDate():"0"+day5.getDate()),
        'week': week[day5.getDay()]
    }
    ];
}

//function findWT(th,techId,dateStr){
//    $('tr .active').each(function(v,value){
//        $(value).removeClass('active');
//    });
//    $(th).addClass('active');
//    var now = new Date();
//    var nowDate = parseInt((now.getMonth() + 1)+ "" +  now.getDate());
//    var nowStr = parseInt(now.getHours() + "" + now.getMinutes());
//    var date = parseInt(replace(dateStr));
//
//    if(techId == undefined){   //没有选美容师,显示所有时间
//        $.get('order/findAllWT',function(result){
//            var html = "";
//            $.each(result.data,function(n,value){
//                if(n == 0){
//                    html += "<tr>";
//                }else if(n == result.data.length){
//                    html += "</tr>"
//                }else if(n % 4 == 0){
//                    html += "</tr><tr>";
//                }
//                if(date <= nowDate && value.time <= nowStr){
//                    html += '<td class="passed"><div>' + value.time + '</div></td>';
//                }else{
//                    html += '<td class="nopassed" ng-click="selTime(\'' + dateStr + '\',\'' + value.time + '\')" ><div>' + value.time + '</div></td>';
//                }
//            });
//            html += "</tr>";
//            var time_body = $('#time_body');
//            time_body.empty();
//            $(html).appendTo(time_body);
//        });
//    }else{   //选择美容师,显示该美容师有空的时间.
//        $.get('order/findWT?techId=' + techId + '&date=' + new Date().getFullYear() + "/" + dateStr,function(result){
//            var html = "";
//            $.each(result.data,function(n,value){
//                if(n == 0){
//                    html += "<tr>";
//                }else if(n == result.data.length){
//                    html += "</tr>"
//                }else if(n % 4 == 0){
//                    html += "</tr><tr>";
//                }
//                if((date <= nowDate && value.time <= nowStr) || value.iw == null){
//                    html += '<td class="passed"><div>' + value.time + '</div></td>';
//                }else{
//                    html += '<td class="nopassed" ng-click="selTime(\'' + dateStr + '\',\'' + value.time + '\')" ><div>' + value.time + '</div></td>';
//                }
//            });
//            html += "</tr>";
//            var time_body = $('#time_body');
//            time_body.empty();
//            $(html).appendTo(time_body);
//        });
//    }
//}

//function replace(str){
//    return str.replace(":","").replace("/","");
//}


function validatemobile(mobile) {
    var myreg = /^0?1[3|4|5|8][0-9]\d{8}$/;
    return myreg.test(mobile);
}

